package com.zj.fx.model.info;

import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 管理提升项目 InfoProjectExample
 * @author SQL_自动生成
 * @date 2023-06-08 13:33:35
 */
public class InfoProjectExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public InfoProjectExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        
            public Criteria andIdIsNull() {
                addCriterion("id is null");
                return (Criteria) this;
            }

            public Criteria andIdIsNotNull() {
                addCriterion("id is not null");
                return (Criteria) this;
            }

            public Criteria andIdEqualTo(String value) {
                addCriterion("id =", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotEqualTo(String value) {
                addCriterion("id <>", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThan(String value) {
                addCriterion("id >", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThanOrEqualTo(String value) {
                addCriterion("id >=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThan(String value) {
                addCriterion("id <", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThanOrEqualTo(String value) {
                addCriterion("id <=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLike(String value) {
                addCriterion("id like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotLike(String value) {
                addCriterion("id not like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdIn(List<String> values) {
                addCriterion("id in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotIn(List<String> values) {
                addCriterion("id not in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdBetween(String value1, String value2) {
                addCriterion("id between", value1, value2, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotBetween(String value1, String value2) {
                addCriterion("id not between", value1, value2, "id");
                return (Criteria) this;
            }

        
            public Criteria andNumIsNull() {
                addCriterion("num is null");
                return (Criteria) this;
            }

            public Criteria andNumIsNotNull() {
                addCriterion("num is not null");
                return (Criteria) this;
            }

            public Criteria andNumEqualTo(String value) {
                addCriterion("num =", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumNotEqualTo(String value) {
                addCriterion("num <>", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumGreaterThan(String value) {
                addCriterion("num >", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumGreaterThanOrEqualTo(String value) {
                addCriterion("num >=", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumLessThan(String value) {
                addCriterion("num <", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumLessThanOrEqualTo(String value) {
                addCriterion("num <=", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumLike(String value) {
                addCriterion("num like", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumNotLike(String value) {
                addCriterion("num not like", value, "num");
                return (Criteria) this;
            }

            public Criteria andNumIn(List<String> values) {
                addCriterion("num in", values, "num");
                return (Criteria) this;
            }

            public Criteria andNumNotIn(List<String> values) {
                addCriterion("num not in", values, "num");
                return (Criteria) this;
            }

            public Criteria andNumBetween(String value1, String value2) {
                addCriterion("num between", value1, value2, "num");
                return (Criteria) this;
            }

            public Criteria andNumNotBetween(String value1, String value2) {
                addCriterion("num not between", value1, value2, "num");
                return (Criteria) this;
            }

        
            public Criteria andTypeIsNull() {
                addCriterion("type is null");
                return (Criteria) this;
            }

            public Criteria andTypeIsNotNull() {
                addCriterion("type is not null");
                return (Criteria) this;
            }

            public Criteria andTypeEqualTo(String value) {
                addCriterion("type =", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeNotEqualTo(String value) {
                addCriterion("type <>", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeGreaterThan(String value) {
                addCriterion("type >", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeGreaterThanOrEqualTo(String value) {
                addCriterion("type >=", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeLessThan(String value) {
                addCriterion("type <", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeLessThanOrEqualTo(String value) {
                addCriterion("type <=", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeLike(String value) {
                addCriterion("type like", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeNotLike(String value) {
                addCriterion("type not like", value, "type");
                return (Criteria) this;
            }

            public Criteria andTypeIn(List<String> values) {
                addCriterion("type in", values, "type");
                return (Criteria) this;
            }

            public Criteria andTypeNotIn(List<String> values) {
                addCriterion("type not in", values, "type");
                return (Criteria) this;
            }

            public Criteria andTypeBetween(String value1, String value2) {
                addCriterion("type between", value1, value2, "type");
                return (Criteria) this;
            }

            public Criteria andTypeNotBetween(String value1, String value2) {
                addCriterion("type not between", value1, value2, "type");
                return (Criteria) this;
            }

        
            public Criteria andContentIsNull() {
                addCriterion("content is null");
                return (Criteria) this;
            }

            public Criteria andContentIsNotNull() {
                addCriterion("content is not null");
                return (Criteria) this;
            }

            public Criteria andContentEqualTo(String value) {
                addCriterion("content =", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentNotEqualTo(String value) {
                addCriterion("content <>", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentGreaterThan(String value) {
                addCriterion("content >", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentGreaterThanOrEqualTo(String value) {
                addCriterion("content >=", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentLessThan(String value) {
                addCriterion("content <", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentLessThanOrEqualTo(String value) {
                addCriterion("content <=", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentLike(String value) {
                addCriterion("content like", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentNotLike(String value) {
                addCriterion("content not like", value, "content");
                return (Criteria) this;
            }

            public Criteria andContentIn(List<String> values) {
                addCriterion("content in", values, "content");
                return (Criteria) this;
            }

            public Criteria andContentNotIn(List<String> values) {
                addCriterion("content not in", values, "content");
                return (Criteria) this;
            }

            public Criteria andContentBetween(String value1, String value2) {
                addCriterion("content between", value1, value2, "content");
                return (Criteria) this;
            }

            public Criteria andContentNotBetween(String value1, String value2) {
                addCriterion("content not between", value1, value2, "content");
                return (Criteria) this;
            }

        
            public Criteria andScoreIsNull() {
                addCriterion("score is null");
                return (Criteria) this;
            }

            public Criteria andScoreIsNotNull() {
                addCriterion("score is not null");
                return (Criteria) this;
            }

            public Criteria andScoreEqualTo(String value) {
                addCriterion("score =", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreNotEqualTo(String value) {
                addCriterion("score <>", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreGreaterThan(String value) {
                addCriterion("score >", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreGreaterThanOrEqualTo(String value) {
                addCriterion("score >=", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreLessThan(String value) {
                addCriterion("score <", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreLessThanOrEqualTo(String value) {
                addCriterion("score <=", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreLike(String value) {
                addCriterion("score like", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreNotLike(String value) {
                addCriterion("score not like", value, "score");
                return (Criteria) this;
            }

            public Criteria andScoreIn(List<String> values) {
                addCriterion("score in", values, "score");
                return (Criteria) this;
            }

            public Criteria andScoreNotIn(List<String> values) {
                addCriterion("score not in", values, "score");
                return (Criteria) this;
            }

            public Criteria andScoreBetween(String value1, String value2) {
                addCriterion("score between", value1, value2, "score");
                return (Criteria) this;
            }

            public Criteria andScoreNotBetween(String value1, String value2) {
                addCriterion("score not between", value1, value2, "score");
                return (Criteria) this;
            }

        
            public Criteria andParentNumIsNull() {
                addCriterion("parent_num is null");
                return (Criteria) this;
            }

            public Criteria andParentNumIsNotNull() {
                addCriterion("parent_num is not null");
                return (Criteria) this;
            }

            public Criteria andParentNumEqualTo(String value) {
                addCriterion("parent_num =", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumNotEqualTo(String value) {
                addCriterion("parent_num <>", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumGreaterThan(String value) {
                addCriterion("parent_num >", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumGreaterThanOrEqualTo(String value) {
                addCriterion("parent_num >=", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumLessThan(String value) {
                addCriterion("parent_num <", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumLessThanOrEqualTo(String value) {
                addCriterion("parent_num <=", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumLike(String value) {
                addCriterion("parent_num like", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumNotLike(String value) {
                addCriterion("parent_num not like", value, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumIn(List<String> values) {
                addCriterion("parent_num in", values, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumNotIn(List<String> values) {
                addCriterion("parent_num not in", values, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumBetween(String value1, String value2) {
                addCriterion("parent_num between", value1, value2, "parentNum");
                return (Criteria) this;
            }

            public Criteria andParentNumNotBetween(String value1, String value2) {
                addCriterion("parent_num not between", value1, value2, "parentNum");
                return (Criteria) this;
            }

        
        public Criteria andLikeQuery(InfoProject record) {
            List<String> list = new ArrayList<String>();
            List<String> list2 = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list.add("ifnull(id,'')");
                }
                            if (record.getNum() != null && StrUtil.isNotEmpty(record.getNum().toString())) {
                    list.add("ifnull(num,'')");
                }
                            if (record.getType() != null && StrUtil.isNotEmpty(record.getType().toString())) {
                    list.add("ifnull(type,'')");
                }
                            if (record.getContent() != null && StrUtil.isNotEmpty(record.getContent().toString())) {
                    list.add("ifnull(content,'')");
                }
                            if (record.getScore() != null && StrUtil.isNotEmpty(record.getScore().toString())) {
                    list.add("ifnull(score,'')");
                }
                            if (record.getParentNum() != null && StrUtil.isNotEmpty(record.getParentNum().toString())) {
                    list.add("ifnull(parent_num,'')");
                }
                                        if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list2.add("'%" + record.getId() + "%'");
                }
                            if (record.getNum() != null && StrUtil.isNotEmpty(record.getNum().toString())) {
                    list2.add("'%" + record.getNum() + "%'");
                }
                            if (record.getType() != null && StrUtil.isNotEmpty(record.getType().toString())) {
                    list2.add("'%" + record.getType() + "%'");
                }
                            if (record.getContent() != null && StrUtil.isNotEmpty(record.getContent().toString())) {
                    list2.add("'%" + record.getContent() + "%'");
                }
                            if (record.getScore() != null && StrUtil.isNotEmpty(record.getScore().toString())) {
                    list2.add("'%" + record.getScore() + "%'");
                }
                            if (record.getParentNum() != null && StrUtil.isNotEmpty(record.getParentNum().toString())) {
                    list2.add("'%" + record.getParentNum() + "%'");
                }
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append(" like CONCAT(");
            buffer.append(StrUtil.join(",", list2));
            buffer.append(")");
            if (!" CONCAT() like CONCAT()".equals(buffer.toString())) {
                addCriterion(buffer.toString());
            }
            return (Criteria) this;
        }

        public Criteria andLikeQuery2(String searchText) {
            List<String> list = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            list.add("ifnull(id,'')");
                            list.add("ifnull(num,'')");
                            list.add("ifnull(type,'')");
                            list.add("ifnull(content,'')");
                            list.add("ifnull(score,'')");
                            list.add("ifnull(parent_num,'')");
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append("like '%");
            buffer.append(searchText);
            buffer.append("%'");
            addCriterion(buffer.toString());
            return (Criteria) this;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}